package com.lidy.tankbattle.event.tankgame1;

import com.lidy.tankbattle.tankgame1.constant.TankPriorities;

import javax.swing.*;

/**
 * @author lidy
 * @version V1.0
 * @classname TankGame1
 * @description 坦克游戏
 * @date 2022/5/28 15:32
 */
public class TankGame1 extends JFrame {

    TankPanel1 mp;

    public TankGame1() {
        mp = new TankPanel1(TankPriorities.PANEL_WIDTH, TankPriorities.PANEL_HEIGHT);
        mp.addTanks(TankPriorities.INIT_MY_TANK_LOCATION_X, TankPriorities.INIT_MY_TANK_LOCATION_Y, TankPriorities.INIT_MY_TANK_DIRECTION);
        this.add(mp);
        this.setSize(TankPriorities.PANEL_WIDTH, TankPriorities.PANEL_HEIGHT);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
        this.addKeyListener(mp);
    }

    public static void main(String[] args) {
        new TankGame1();
    }
}
